package com.example.springboot;

import com.example.springboot.service.LoginService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class Application {

    public static void main(String[] args) {
        ConfigurableApplicationContext  context =
                SpringApplication.run(Application.class,args);

        String username = "wang";
        String password = "123456";

        context.getBean(LoginService.class).login(username, password);
        LoginService loginService=context.getBean(LoginService.class);
        loginService.login(username, password);
    }

}
